package com.muzi.decorator;


import com.muzi.factory.FarmEquipment;
import com.muzi.factory.Override;

// GPS功能装饰器
public class GPSDecorator implements FarmEquipment {
    // 农场设备
    private final FarmEquipment decorated;

    public GPSDecorator(FarmEquipment decorated) {
        this.decorated = decorated;
    }

    @Override
    public void operate() {
        decorated.operate(); // 执行原功能
        addGPSFunctionality(); // 添加新功能
    }

    //添加新功能
    private void addGPSFunctionality() {
        System.out.println("已增强此功能：添加GPS定位追踪。");
    }
}
